Swift Next
Swift syntax package in async/await era, with extra features, for Sublime Text.
Details
Installs
- Total 2K
- Win 219
- Mac 2K
- Linux 146
| Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 2 | 2 | 2 | 3 | 0 | 1 | 1 | 2 | 1 | 0 | 1 | 1 | 2 | 0 | 2 | 3 | 4 | 0 | 0 | 1 | 1 | 2 | 2 | 2 | 1 | 2 | 3 | 1 | 1 | 3 | 5 | 2 | 2 | 1 | 5 | 1 | 3 | 0 | 3 | 3 | 1 | 4 | 2 | 3 | 2 | 1 |
| Linux | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Swift Next
Modern Swift syntax for Sublime Text 4
This fork maintains the Swift Next syntax package for modern Swift, targeting Swift 6.4 / 6.4.1. The original grammar and Xcode-style symbol-list integration were created by @aerobounce; this fork builds on that work and the Swift-Next community fork.
Features
- Swift 5.7–6.4 syntax additions: macro declarations and expansions, parameter packs, primary associated types,
packageaccess, ownership modifiers, noncopyable and nonescapable conformances, typed throws,sending, and isolation options. - Swift 6.4 module selectors (
Module::name), optionalsome/anytypes,borrow/mutateaccessors, and modern built-in attributes including@diagnose. - Bare and extended regex literals, character classes, escapes, quantifiers, and multiline extended patterns.
- Raw strings with matching hash delimiters and interpolation, without treating string contents as comments.
- Modern library symbols including
Task, clocks,Regex,InlineArray, spans,UniqueArray,UniqueBox,Ref,MutableRef, andIterable. - Documentation comments,
MARK:/TODO:/FIXME:, and Xcode-style symbol lists.
This is a syntax-highlighting package, not a Swift compiler or language server. Standard-library highlighting is name-based; it does not resolve shadowed names. Existing historical symbol lists are retained for compatibility. Language features that require compiler flags still require those flags in your toolchain.

Compatibility
- Sublime Text 4 (syntax format version 2).
.swiftand.swiftinterfacefiles.- Latest language target checked against the Swift 6.4 release announcement and Swift 6.4.1 release notes.
- Swift 5.6-era highlighting is retained. Deprecated syntax is not the focus of ongoing maintenance.
See CHANGELOG.md for changes and tests/README.md for verification instructions.
Install
Package Control
The community package is named Swift Next. Package Control installs the published community package; it does not automatically include unmerged changes from this personal fork. Use manual installation below to use this fork.
This fork
- Open Preferences → Browse Packages… in Sublime Text.
- Clone or copy this repository into a directory named
Swift Nextdirectly insidePackages(alongsideUser, not inside it). - Avoid loading another Swift Next copy at the same time. Disable/remove the Package Control copy if replacing it with this checkout.
- Select View → Syntax → Swift for Swift files. Reopen the file if its previous syntax assignment was cached.
Build and run
The build system uses the swift executable from your environment. It does not install a toolchain or force a language mode.
- Swift runs the current file; paths containing spaces are passed as one argument.
- Package: Build / Test / Resolve / Update / Clean run SwiftPM in the project folder. Open the package root as a Sublime project folder first.
Development
Editing Environment
- Sublime Text 4
- PackageDev
- SublimeLinter-contrib-sublime-syntax
- LSP-yaml
- LSP-json
- Formatted with LSP-yaml and LSP-json
Validation
Run ruby utils/check_syntax.rb from the repository root for YAML, context-reference, meta-pattern ordering, and regex compilation checks. Ruby's regex engine differs from Sublime's, so this is a preliminary check; native scope assertions remain the authoritative check. See tests/README.md to run them in Sublime Text. GitHub Actions runs native tests against stable and development Sublime builds.
Tips
Minimize multiple words into a regex pattern
$ grex --no-anchors --capture-groups ...
References
If you are to create a syntax definition file for the first time without deep regex background like me, here's everything you need.
Sublime Text
- Sublime Text — Syntax Definitions
- Sublime Text — Scope Naming
- Sublime Text Community Documentation
- sublimehq/Packages
- sublimehq/Packages — Syntax Development Tips/Advice #757
Regular Expression
Swift
- apple/swift
- The Swift Programming Language
- Swift Standard Library
.swiftinterfacefiles in:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/swift- DougGregor/swift-concurrency-objc
- textmate/swift.tmbundle
- wbond/swift-for-sublime (
floating-point-literalandstring-literalare modified version of this package 🙏) - GregoryBL/SwiftSyntax
Other Fundamental Packages for Swift
License
- MIT